package com.lgx.mall.business.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.lgx.common.entity.IdGenerator;
import com.lgx.common.web.util.DateUtils;

/**
 * 积分赠送记录
 * 
 * @author Administrator
 *
 */
@Entity
@Table(name="TM_SCORE_GIFT_RECORDS")
public class ScoreGiftRecords implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator=IdGenerator.GIFTRECORD_ID_GENERATOR)
	@TableGenerator(
			name = IdGenerator.GIFTRECORD_ID_GENERATOR,
			table = IdGenerator.GENERATOR_TABLE,
			pkColumnName = IdGenerator.GEN_NAME,
			pkColumnValue = IdGenerator.GIFTRECORD_ID_GENERATOR,
			valueColumnName = IdGenerator.GEN_VALUE,
			initialValue = 1,
			allocationSize = 1
	)
	private long id;
	
	/**
	 * 发起人
	 */
	@Column(name="from_user_id")
	private long fromId;
	
	private String fromName;
	
	/**
	 * 接受人
	 */
	@Column(name="to_user_id")
	private long toId;
	
	private String toName;
	
	/**
	 * 积分
	 */
	private Double score;
	
	/**
	 * 赠送时间
	 */
	private Date giftTime;
	
	/**
	 * 备注
	 */
	private String remark;

	
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getFromId() {
		return fromId;
	}

	public void setFromId(long fromId) {
		this.fromId = fromId;
	}

	public String getFromName() {
		return fromName;
	}

	public void setFromName(String fromName) {
		this.fromName = fromName;
	}

	public long getToId() {
		return toId;
	}

	public void setToId(long toId) {
		this.toId = toId;
	}

	public String getToName() {
		return toName;
	}

	public void setToName(String toName) {
		this.toName = toName;
	}

	public Double getScore() {
		return score;
	}

	public void setScore(Double score) {
		this.score = score;
	}

	public Date getGiftTime() {
		return giftTime;
	}
	
	public String time(){
		return DateUtils.dateToChar(getGiftTime(), DateUtils.DATE_FORMAT_D);
	}

	public void setGiftTime(Date giftTime) {
		this.giftTime = giftTime;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}
